API Documentation
Node.h
1 // Node.h
3 //
5 
6 namespace nkExport
7 {
12  {
22  } ;
23 
28  {
33  } ;
34 }
35 
36 namespace nkExport
37 {
41  class Node final
42  {
43  public :
44 
48  Node () ;
54  Node (const Node& other) ;
60  Node (Node&& other) ;
64  ~Node () ;
65 
66  // Getters
78  bool isValueTypeNumber () const ;
90  int getValueAsInt () const ;
96  unsigned int getValueAsUint () const ;
102  long long getValueAsLong () const ;
108  unsigned long long getValueAsUlong () const ;
114  float getValueAsFloat () const ;
120  double getValueAsDouble () const ;
126  bool getValueAsBool () const ;
130  unsigned int getMemberCount () const ;
138  nkMemory::StringView getMemberKey (unsigned int index) ;
145  Node* getMemberValue (unsigned int index) ;
156  unsigned int getArraySize () const ;
161  Node* getArrayElement (unsigned int index) ;
165  void* getUserData () const ;
166 
167  // Setters
173  void setAsString (const nkMemory::StringView& value) ;
179  void setAsInt (int value) ;
185  void setAsUint (unsigned int value) ;
191  void setAsLong (long long value) ;
197  void setAsUlong (unsigned long long value) ;
203  void setAsFloat (float value) ;
209  void setAsDouble (double value) ;
215  void setAsBool (bool value) ;
232  void deleteMember (const nkMemory::StringView& key) ;
247  void setUserData (void* value) ;
248 
249  // Operators
256  Node& operator= (const Node& other) ;
263  Node& operator= (Node&& other) ;
264  } ;
265 }
nkExport::Node::getValueAsUint
unsigned int getValueAsUint() const
nkExport::Node::setAsFloat
void setAsFloat(float value)
nkExport::Node::setAsBool
void setAsBool(bool value)
nkExport::Node::getValueAsFloat
float getValueAsFloat() const
nkExport::EMPTY_NATURE
@ EMPTY_NATURE
Represents an empty node.
Definition: Node.h:29
nkExport::Node::setAsUint
void setAsUint(unsigned int value)
nkExport::Node::operator=
Node & operator=(const Node &other)
nkExport::FLOAT_TYPE
@ FLOAT_TYPE
A node holding a float.
Definition: Node.h:20
nkExport::DOUBLE_TYPE
@ DOUBLE_TYPE
A node holding a double.
Definition: Node.h:21
nkExport::Node::~Node
~Node()
nkExport::Node::addMember
Node * addMember(const nkMemory::StringView &key)
nkExport
Encompasses all API of component NilkinsExport.
Definition: Base64Encoder.h:7
nkExport::Node::addElement
Node * addElement()
nkExport::Node::getMemberValue
Node * getMemberValue(const nkMemory::StringView &key)
nkExport::Node::getMemberValue
Node * getMemberValue(unsigned int index)
nkExport::Node::isValueTypeNumber
bool isValueTypeNumber() const
nkExport::Node::getMemberCount
unsigned int getMemberCount() const
nkExport::Node::deleteMember
void deleteMember(const nkMemory::StringView &key)
nkExport::Node::getValueAsBool
bool getValueAsBool() const
nkExport::Node::getValueAsDouble
double getValueAsDouble() const
nkExport::Node::getUserData
void * getUserData() const
nkExport::STRING_TYPE
@ STRING_TYPE
A node holding a string.
Definition: Node.h:15
nkExport::Node::setAsLong
void setAsLong(long long value)
nkExport::NODE_VALUE_TYPE
NODE_VALUE_TYPE
Describes the kind of value a node holds.
Definition: Node.h:12
nkExport::UINT_TYPE
@ UINT_TYPE
A node holding an unsigned integer.
Definition: Node.h:17
nkExport::Node
A node in the tree structure representing the data to export / import.
Definition: Node.h:42
nkExport::Node::getValueAsLong
long long getValueAsLong() const
nkExport::Node::getNodeNature
NODE_NATURE getNodeNature() const
nkExport::OBJECT_NATURE
@ OBJECT_NATURE
Represents a node holding references to other nodes, via the named member accessors.
Definition: Node.h:31
nkExport::Node::Node
Node(Node &&other)
nkExport::Node::setAsString
void setAsString(const nkMemory::StringView &value)
nkExport::VALUE_NATURE
@ VALUE_NATURE
Represents a leaf node, holding a final value being either a bool, string, int, uint,...
Definition: Node.h:30
nkExport::LONG_TYPE
@ LONG_TYPE
A node holding a long (8 bytes).
Definition: Node.h:18
nkMemory::StringView
Class holding information about a string, with no ownership over the data.
Definition: StringView.h:22
nkExport::Node::getValueAsString
nkMemory::StringView getValueAsString() const
nkExport::BOOL_TYPE
@ BOOL_TYPE
A node holding a boolean.
Definition: Node.h:14
nkExport::INT_TYPE
@ INT_TYPE
A node holding an integer.
Definition: Node.h:16
nkExport::Node::getValueAsUlong
unsigned long long getValueAsUlong() const
nkExport::Node::setAsDouble
void setAsDouble(double value)
nkExport::Node::getMemberKey
nkMemory::StringView getMemberKey(unsigned int index)
nkExport::NODE_NATURE
NODE_NATURE
Describes the nature of a node.
Definition: Node.h:28
nkExport::Node::setAsInt
void setAsInt(int value)
nkExport::Node::Node
Node(const Node &other)
nkExport::Node::getNodeValueType
NODE_VALUE_TYPE getNodeValueType() const
nkExport::NOT_VALUE_TYPE
@ NOT_VALUE_TYPE
A node which is an object or an array will have no value attached. In such case, this value is return...
Definition: Node.h:13
nkExport::ULONG_TYPE
@ ULONG_TYPE
A node holding an unsigned long (8 bytes).
Definition: Node.h:19
nkExport::Node::getArrayElement
Node * getArrayElement(unsigned int index)
nkExport::Node::getValueAsInt
int getValueAsInt() const
nkExport::Node::Node
Node()
nkExport::ARRAY_NATURE
@ ARRAY_NATURE
Represents a node holding references to other nodes, via the indexed array accessors.
Definition: Node.h:32
nkExport::Node::setAsUlong
void setAsUlong(unsigned long long value)
nkExport::Node::setUserData
void setUserData(void *value)
nkExport::Node::getArraySize
unsigned int getArraySize() const